/*
 * @Author: wuzhouhai wzh200x@126.com
 * @Date: 2024-03-20 13:47:34
 * @LastEditors: wuzhouhai wzh200x@126.com
 * @LastEditTime: 2024-04-18 16:58:46
 * @FilePath: \phoenix-client-damo\assets\src\phoenix\entities\Account.ts
 * @Description: 
 */
import { PlatformDefine } from "../defines/platform.define";
import Entity from "./Entity";

export class Account extends Entity{
    private accountName:string;
    private accountPassword:string;
    private thirdAccount:string;
    private thirdToken:string;
    private thirdTokenExpireTime:number;
    private token:string;
    private tokenExpireTime:number;
    private avatarId:number;
    private servers:number[];
    public constructor(name:string, password:string){
        super();
        this.accountName = name;
        this.accountPassword = password;
        this.thirdAccount = '';
        this.thirdToken = '';
        this.thirdTokenExpireTime = 0;
        this.token = '';
        this.tokenExpireTime = 0;
        this.avatarId = 0;
    }

    public getAccountName():string{
        return this.accountName;
    }

    public setAccountName(name:string):void{
        if(this.accountName != ''){
            return;
        }
        this.accountName = name;
    }

    public getAccountPassword():string{
        return this.accountPassword;
    }

    public getToken():string{
        return this.token;
    }

    public setToken(token:string):void{
        this.token = token;
    }

    public getTokenExpireTime():number{
        return this.tokenExpireTime;
    }

    public setTokenExpireTime(time:number):void{
        this.tokenExpireTime = time;
    }

    public getAvatarId():number{
        return this.avatarId;
    }

    public setAvatarId(id:number):void{
        this.avatarId = id;
    }

    public getThirdAccount():string{
        return this.thirdAccount;
    }

    public setThirdAccount(account:string):void{
        this.thirdAccount = account;
    }

    public getThirdToken():string{
        return this.thirdToken;
    }

    public setThirdToken(token:string):void{
        this.thirdToken = token;
    }

    public getThirdTokenExpireTime():number{
        return this.thirdTokenExpireTime;
    }

    public setThirdTokenExpireTime(time:number):void{
        this.thirdTokenExpireTime = time;
    }

    public setServers(servers:number[]):void{
        this.servers = servers;
    }

    public getServers():number[]{
        return this.servers;
    }

    public getDefauteServer():number{
        if(this.servers.length > 0){
            return this.servers[this.servers.length - 1];
        }
        return -1;
    }
}